package com.smily.excel;

import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;

import java.io.File;

/**
 * Created by Smily on 10/17/15.
 */
public class JxlReadExcel {
    public static void main(String[] args){

        try {
            //创建
            Workbook workbook = Workbook.getWorkbook(new File("/Users/Smily/Documents/Coding/idae_output/jxl_test.xls"));
            //获取sheet页
            Sheet sheet = workbook.getSheet(0);
            //获取数据
            for(int i =0; i < sheet.getRows(); i++){
                for (int j = 0; j < sheet.getColumns(); j++){
                    Cell cell = sheet.getCell(j , i);
                    System.out.print(cell.getContents() + ' ');
                }
                System.out.println();
            }
            workbook.close();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
